home *** CD-ROM | disk | FTP | other *** search
Wrap
/* Font.h Application Kit, Release 2.1J Copyright (c) 1988, 1989, 1990, NeXT, Inc. All rights reserved. */ #import <Foundation/Foundation.h> #import "NSFontManager.h" extern const float *NSFontIdentityMatrix; /* * Figure is also known as non-breaking space. * NX_EMSPACE, NX_ENSPACE and NX_THINSPACE have been removed as part of * the switch to the NextStep encoding. */ #define NSFontFigureSpace ((unsigned short)0x80) typedef unsigned int NSGlyph; @interface NSFont : NSObject { NSString * name; float size; int style; float *matrix; int fontNum; struct _NSFaceInfo *faceInfo; id otherFont; struct _fFlags { #ifdef __BIG_ENDIAN__ /* the following two instance variables are no longer part of the API */ unsigned int usedByWS:1; unsigned int usedByPrinter:1; unsigned int isScreenFont:1; unsigned int _systemFontType:4; unsigned int _RESERVED:6; unsigned int _matrixIsIdentity:1; unsigned int _matrixIsFlipped:1; unsigned int _hasStyle:1; #else unsigned int _hasStyle:1; unsigned int _matrixIsFlipped:1; unsigned int _matrixIsIdentity:1; unsigned int _RESERVED:6; unsigned int _systemFontType:4; unsigned int isScreenFont:1; /* the following two instance variables are no longer part of the API */ unsigned int usedByPrinter:1; unsigned int usedByWS:1; #endif } fFlags; unsigned short _reservedFont2; unsigned int _reservedFont3; } + (NSFont *)fontWithName:(NSString *)fontName size:(float)fontSize; + (NSFont *)fontWithName:(NSString *)fontName matrix:(const float *)fontMatrix; + useFont:(NSString *)fontName; + (NSFont *)userFontOfSize:(float)fontSize; + (NSFont *)userFixedPitchFontOfSize:(float)fontSize; + (NSFont *)systemFontOfSize:(float)fontSize; + (NSFont *)boldSystemFontOfSize:(float)fontSize; + (void)setUserFont:(NSFont *)aFont; + (void)setUserFixedPitchFont:(NSFont *)aFont; - (float)pointSize; - (NSString *)fontName; - (NSString *)familyName; - (NSString *)displayName; - (const float *)matrix; - set; - (float)widthOfString:(NSString *)string; - (NSFont *)screenFont; - (NSFont *)printerFont; - (BOOL)isBaseFont; /* The "widths" method returns a pointer to an array of 256 widths. They are unscaled but are pre-divided by 1000. All other methods return scaled numbers. If the font was created with a matrix, the matrix is applied automatically; otherwise the coordinates are multiplied by size. */ - (float *)widths; - (NSRect)boundingRectForFont; - (NSRect)boundingRectForGlyph:(NSGlyph)aGlyph; - (NSSize)advancementForGlyph:(NSGlyph)ag; - (NSPoint)positionOfGlyph:(NSGlyph)curGlyph precededByGlyph:(NSGlyph)prevGlyph isNominal:(BOOL *)nominal; - (NSDictionary *)afmDictionary; - (NSString *)afmFileContents; - (BOOL)glyphIsEncoded:(NSGlyph)aGlyph; @end /* These are the strings that are available in the "afmDictionary". For other things, use "afmFileContents". The floating point values (e.g., ascender, cap height) can be converted to floating point via NSString's "floatValue" method. */ extern NSString *NSAFMFamilyName; extern NSString *NSAFMFontName; extern NSString *NSAFMFormatVersion; extern NSString *NSAFMFullName; extern NSString *NSAFMNotice; extern NSString *NSAFMVersion; extern NSString *NSAFMWeight; extern NSString *NSAFMEncodingScheme; extern NSString *NSAFMCharacterSet; extern NSString *NSAFMCapHeight; extern NSString *NSAFMXHeight; extern NSString *NSAFMAscender; extern NSString *NSAFMDescender; extern NSString *NSAFMUnderlinePosition; extern NSString *NSAFMUnderlineThickness; extern NSString *NSAFMItalicAngle; extern NSString *NSAFMMappingScheme;